package cn.com.shopec.erp.base.entity;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name = "TBL_SUPPLIER_ACCOUNTS")
public class SupplierAccounts {
	
	/** ID */
	private String id;
	
	/** 结算类型（1：购销结算 2：代销结算） */
	private String accountsType;
	
	/** 扣点比例 */
	private String pointsScale;
	
	/** 结算方式 （1：扣点 2：底价）*/
	private String accountsWay;
	
	/** 结算周期 */
	private String accountsTime;
	
	/** 删除标识（0：已删除 1：未删除） */
	private Integer deleteFlag;

	private SupplierInfo supplierInfo;
	
	/** 品牌名称 */
	private String brandName;
	
	/** 品牌编码 */
	private String brandCode;

	
	@GenericGenerator(name = "generator", strategy = "uuid.hex")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "id", unique = true, nullable = false, length = 32)
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Column(name = "ACCOUNTS_TYPE")
	public String getAccountsType() {
		return accountsType;
	}

	public void setAccountsType(String accountsType) {
		this.accountsType = accountsType;
	}
	@Column(name = "POINTS_SCALE")
	public String getPointsScale() {
		return pointsScale;
	}

	public void setPointsScale(String pointsScale) {
		this.pointsScale = pointsScale;
	}
	@Column(name = "ACCOUNTS_WAY")
	public String getAccountsWay() {
		return accountsWay;
	}

	public void setAccountsWay(String accountsWay) {
		this.accountsWay = accountsWay;
	}
	
	@Column(name = "ACCOUNTS_TIME")
	public String getAccountsTime() {
		return accountsTime;
	}

	public void setAccountsTime(String accountsTime) {
		this.accountsTime = accountsTime;
	}
	
	@Column(name = "DELETE_FLAG")
	public Integer getDeleteFlag() {
		return deleteFlag;
	}

	public void setDeleteFlag(Integer deleteFlag) {
		this.deleteFlag = deleteFlag;
	}

	@ManyToOne(fetch = FetchType.LAZY,cascade = CascadeType.REFRESH,optional=true)
	@JoinColumn(name ="CODE", nullable=true, referencedColumnName="CODE")
	public SupplierInfo getSupplierInfo() {
		return supplierInfo;
	}

	public void setSupplierInfo(SupplierInfo supplierInfo) {
		this.supplierInfo = supplierInfo;
	}

	@Column(name ="BRAND_NAME")
	public String getBrandName() {
		return brandName;
	}

	public void setBrandName(String brandName) {
		this.brandName = brandName;
	}

	@Column(name ="BRAND_CODE")
	public String getBrandCode() {
		return brandCode;
	}

	public void setBrandCode(String brandCode) {
		this.brandCode = brandCode;
	}
	
	
	
	
	
}
